package com.qiaofang.collectmanage.constants;

import java.util.Arrays;
/**
 * Copyright (C), 2002-2017, 上海巧房信息技术有限公司
 * FileName: ElementRuleFieldEnum
 * Author:   yi.li
 * Date:     2018/7/6 16:54
 * Description: 元素规则字段
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
public enum ElementRuleFieldEnum {

    ID("id","主键"),
    COLLECT_RULE_UUID("collectRuleUuid","采集规则UUID"),
    DEPTH("depth","深度"),
    DEPTH_DESC("depthDesc","深度描述"),
    FIELD_NAME("fieldName","采集字段名称"),
    RETURN_ELEMENT("returnElement","定位元素"),
    RETURN_ELEMENT_VALUE("returnElementValue","提取元素对应的值"),
    RETURN_VALUE("returnValue","对元素后续的值进行操作"),
    DELETED("deleted","是否已经被逻辑删除"),
    CREATED_USER_ID("createdUserId","创建人"),
    CREATED_TIME("createdTime","创建时间"),
    UPDATED_USER_ID("updatedUserId","更新人"),
    UPDATED_TIME("updatedTime","更新时间");

    /**
     * 枚举值
     */
    private String value;

    private String desc;

    ElementRuleFieldEnum(String value,String desc) {
        this.value = value;
        this.desc = desc;
    }
    /**
     * 判断是否存在枚举value
     */
    public static boolean valueExist(String value) {
        return Arrays.stream(ElementRuleFieldEnum.values()).anyMatch(obj -> obj.getValue().equals(value));
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

}
